home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / c / helpcpp.exe / HELP.DOC < prev   
Text File  |  1992-07-23  |  2KB  |  59 lines

  1. Our project needed a smarter help - one where we could back up using
  2. Alt-F1 from a previous help.  The functionality we decided upon uses a
  3. 'fence'.  That is the lowest level of help is a table of contenets and
  4. is always available - it is 'fenced' from change.  To do this, we
  5. preload the lowest level of help: .topic Nocontext=0.  This topic is set
  6. up as a table of contents.  Since it is defined as level '0', it also
  7. becomes the default help screen.  Each time a 'hypertext' link is
  8. invoked, Alt-F1 will return you to the previous level, loosing the
  9. reference from which you just came.  This seems to be the same
  10. functionality of the Borland help and that of the Micosoft Quick Help.
  11.  
  12. We did decide to reinitialize on each entry to the help system.  Thus
  13. multiple entries to the help system would, at first, provide the table
  14. of contents if Alt-F1 is invoked rather that some previous help screen
  15. you've viewed.
  16.  
  17. The implementation uses a stack of fixed size.  Imagine what you should
  18. do when entering a new link:
  19.  
  20.   Save the current context in the stack and move to the next topic.
  21.  
  22. This implies storing the 'current' context so it can be saved on the
  23. stack when the next topic is entered.  Now when the stack is popped,
  24. you'll get the previous context.
  25.  
  26. The context information is just an integer help value:  hcXXX as
  27. produced by TVHC.EXE. The stack is an array of integers.  An alternate
  28. implementation might abstract this with templates and a dynamic array.
  29. I decided to cut to the chase.
  30.  
  31. (By the way, I modified tvhc.cpp so lines in a help text file beginning
  32. with ';' are treated as comments.  We decided comments in the help file
  33. might be good).
  34.  
  35. To keep the changes localized, I added the Stack class local to
  36. help.cpp.
  37.  
  38. There are two files here.
  39.  
  40.   help.dif    - is a diff file between help.cpp and my version.  (If
  41.           you ever do things in Unix and do not have the MKS
  42.           tool-kit I have pitty).
  43.  
  44.   help.cpp    - my modified version.
  45.  
  46. Excuse the lack of comments in the source file.  Some years ago I
  47. noticed that none of the compilers I use correctly compile comments.
  48. Instead they were ignored!  Thus non-sense comments seemed to compile
  49. just as well as correct ones.  We need smarter compilers :-).
  50.  
  51.  
  52. Dave Hillman
  53. 74045,1127
  54. July 13, 1992
  55.  
  56.  
  57.  
  58. Dave Hillman
  59.